<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>test page</title>
</head>
<body>
	<div>
		<p>You should use this page inside of an iframe</p>
	</div>
	<textarea name="code" id="code" cols="30" rows="10"></textarea>
	<input type="text">
	<input type="email" name="e">
	<input type="password" name="p">
	<input type="button" value="magical text!" id="magic-button1">
	<input type="button" value="magically appear!" id="magic-button2">
	<input type="button" value="double click me!" id="dblclick">
	<span id="right-click">right click me!</span>
	<a href="baidu.com">content</a>
	<select name="select">
		<option value="1">One</option>
		<option value="2">Two</option>
		<option value="3">Three</option>
	</select>
	<span id="magic-content"></span>
	<span id="magic-span" style="display:none"></span>
	<h1>ta</h1>
	<div>
		<p id="mouse-over">mouse over me</p>
		<p id="mouse-over-content" style="display: none">here I am</p>
	</div>
	
	<script>
		(function() {
			function selectById(selector) {
				return document.getElementById(selector);
			}
			
			var span = selectById('magic-content');
			var btn1 = selectById('magic-button1');
			
			btn1.addEventListener('click', function () {
				span.innerHTML = '出现了';
			});
			
			var btn2 = selectById('magic-button2');
			var span2 = selectById('magic-span');
			btn2.addEventListener('click', function () {
				span.style.display = 'inline';
			});
			
			var btnDblclick = selectById('dblclick');
			btnDblclick.addEventListener('dblclick', function () {
				span.innerHTML = '双击了';
			});
			
			var spanRClick = selectById('right-click');
			spanRClick.addEventListener('rclick', function () {
				span.innerHTML = '右键了';
			});
			
			var mouseOver = selectById('mouse-over');
			var revealContent = selectById('mouse-over-content');
			mouseOver.addEventListener('mouse-enter', function () {
				revealContent.display = 'block';
			});
			
			mouseOver.addEventListener('mouse-leave', function () {
				revealContent.display = 'none';
			})
		})();
	</script>
</body>
</html>